<template>
  <el-dialog :title="title"
             :close-on-click-modal="false"
             :visible.sync="addOrEditShow"
             width="540px"
             :before-close="handleClose">
    <el-form :model="dialogForm"
             ref="dialogForm"
             :rules="rules"
             label-width="100px">
      <el-form-item label="园区名称："
                    prop="name">
        <el-input v-model="dialogForm.name"
                  size="small"
                  placeholder="请输入园区名称"></el-input>
      </el-form-item>
      <el-form-item label="所在校区："
                    prop="schoolAreaId">
        <el-select v-model="dialogForm.schoolAreaId"
                   style="width: 100%"
                   size="small"
                   placeholder="请选择所在校区">
          <el-option v-for="item in schoolList"
                     :key="item.id"
                     :label="item.name"
                     :value="item.id">
          </el-option>
        </el-select>
      </el-form-item>
    </el-form>
    <span slot="footer"
          class="dialog-footer">
      <el-button @click="handleClose"
                 size="small">取 消</el-button>
      <el-button type="primary"
                 @click="addOrEditSure"
                 size="small">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export default {
  props: {
    addOrEditShow: Boolean,
    dialogForm: Object,
    schoolList: Array,
    addOrEditSure: Function,
    handleClose: Function,
    title: String,
    rules: Object
  }
}
</script>
